#include "BindingSphere.h"

namespace collisions
{
	BindingSphere::BindingSphere()
	{

	}

	BindingSphere::BindingSphere(const Vector3D _pos, float _radius)
	{
		pos = Vector3D(_pos.X, _pos.Y, _pos.Z);
		radius = _radius;
	}

	bool BindingSphere::collidesWith(const BindingSphere o)
	{
		Vector3D jad = pos - o.pos;
		return jad.lengthSquared() < (radius + o.radius) * (radius + o.radius);
	}

	void BindingSphere::moveTo(Vector3D newPosition)
	{
		pos = newPosition;
	}

	void BindingSphere::moveBy(Vector3D translation)
	{
		pos += translation;
	}
}